import request from '@/utils/request'

export function getRoleByPage(data) {
  return request({
    url: '/sys/sysrole_getRoleList',
    method: 'post',
    data,
  })
}

export function createRole(data) {
  return request({
    url: '/sys/sysrole_save',
    method: 'post',
    data,
  })
}

export function updateRole(data) {
  return request({
    url: '/sys/sysrole_editsave',
    method: 'post',
    data,
  })
}

export function deleteRole(ids) {
  return request({
    url: '/sys/sysrole_del',
    method: 'post',
    data: {
      ids: ids instanceof Array ? ids : [ids],
    },
  })
}
